/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JFrmMain.java
 *
 * Created on Mar 24, 2009, 7:07:26 AM
 */
package org.grid.maingui;

import org.grid.gui.LookAndFeelManager;

/**
 *
 * @author wellington
 */
public class JFrmMain extends javax.swing.JFrame {

    public JFrmMain() {
        LookAndFeelManager.initLookAndFeel();
        initComponents();
        JFrmNode.getInstance();
        JFrmHelp.getInstance();
        JFrmProcess.getInstance();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDesktopPane = new javax.swing.JDesktopPane();
        jToolBar = new javax.swing.JToolBar();
        btnNode = new javax.swing.JButton();
        btnProcess = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JToolBar.Separator();
        btnHelp = new javax.swing.JButton();
        pnlStatus = new javax.swing.JPanel();
        lblStatus = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Processamento de LOG's");
        setExtendedState(MAXIMIZED_BOTH);
        setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage(getClass().getResource("/org/grid/maingui/main.png")));
        setIconImages(null);

        jDesktopPane.setBackground(java.awt.SystemColor.control);
        jDesktopPane.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        getContentPane().add(jDesktopPane, java.awt.BorderLayout.CENTER);

        jToolBar.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jToolBar.setFloatable(false);
        jToolBar.setRollover(true);

        btnNode.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/grid/resources/node32x32.png"))); // NOI18N
        btnNode.setText("Nós de Processamento");
        btnNode.setFocusable(false);
        btnNode.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnNode.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnNode.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNodeActionPerformed(evt);
            }
        });
        jToolBar.add(btnNode);

        btnProcess.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/grid/resources/process32x32.png"))); // NOI18N
        btnProcess.setText("Processar Log");
        btnProcess.setFocusable(false);
        btnProcess.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnProcess.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnProcess.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProcessActionPerformed(evt);
            }
        });
        jToolBar.add(btnProcess);
        jToolBar.add(jSeparator1);

        btnHelp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/grid/resources/help32x32.png"))); // NOI18N
        btnHelp.setText("Ajuda");
        btnHelp.setFocusable(false);
        btnHelp.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnHelp.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnHelp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHelpActionPerformed(evt);
            }
        });
        jToolBar.add(btnHelp);

        getContentPane().add(jToolBar, java.awt.BorderLayout.NORTH);

        pnlStatus.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        pnlStatus.add(lblStatus);

        getContentPane().add(pnlStatus, java.awt.BorderLayout.PAGE_END);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-653)/2, (screenSize.height-514)/2, 653, 514);
    }// </editor-fold>//GEN-END:initComponents

    private void btnNodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNodeActionPerformed
        JFrmNode.getInstance(jDesktopPane);
    }//GEN-LAST:event_btnNodeActionPerformed

    private void btnProcessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProcessActionPerformed
        JFrmProcess.getInstance(jDesktopPane);
    }//GEN-LAST:event_btnProcessActionPerformed

    private void btnHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHelpActionPerformed
        JFrmHelp.getInstance(jDesktopPane);
    }//GEN-LAST:event_btnHelpActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnHelp;
    private javax.swing.JButton btnNode;
    private javax.swing.JButton btnProcess;
    private javax.swing.JDesktopPane jDesktopPane;
    private javax.swing.JToolBar.Separator jSeparator1;
    private javax.swing.JToolBar jToolBar;
    private javax.swing.JLabel lblStatus;
    private javax.swing.JPanel pnlStatus;
    // End of variables declaration//GEN-END:variables
}
